<? global $orders, $i; ?>
<?
	global $FullUrl, $lg;
	
	$domain = "http://".GetFullDomain().$FullUrl;
?>
<script src="js/admin/orders.js"></script>
<script src="js/admin/functions2.js" type="text/javascript"></script>
<script src="js/jquery/jquery.selectbox-0.5.js" type="text/javascript"></script>

<form name="f" id="f" method="post">
<!--  start message-green -->
<? if(isset($_SESSION['mess'])){ ?>
<div id="message-green">
  <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
      <td class="green-left"><?=$_SESSION['mess']==1?'Add successfully':$_SESSION['mess']?>
        <a href="admin.php?do=orders&act=add">
        <?=$_SESSION['mess']=='Add successfully'?'Add new one.':''?>
        </a></td>
      <td class="green-right"><a class="close-green"><img src="images/table/icon_close_green.gif"   alt="" /></a></td>
    </tr>
  </table>
</div>
<? }; unset($_SESSION['mess']); ?>
<!--  end message-green -->

<div id="actions-box" style="margin-bottom:10px;">
<a class="action-slider activated" href=""></a>
<div id="actions-box-slider" style="display: none;">
<a class="action-delete" onclick="ChangeAction('admin.php?do=orders&act=dellist<?=isset($_GET['page'])?'&page='.$_GET['page']:''?>');return false;" href="">Delete</a> 
<a class="action-show" href="admin.php?do=orders">All</a> 
<a class="action-add" href="admin.php?do=orders&show=0">Not Paid</a> 
<a class="action-add" href="admin.php?do=orders&show=1">Paid</a> 
</div>
  <div class="clear"></div>
</div>
<div style="height:20px;">&nbsp;</div>
<table width="100%" cellspacing="0" cellpadding="0" border="0" id="product-table">
  <tbody>
    <tr>
      <th class="table-header-check" width="39"><a id="toggle-all"></a> </th>
      <th class="table-header-repeat line-left" width="40"><a href="">Mã đơn hàng</a></th>
      <th class="table-header-repeat line-left" width="140"><a href="">Khách hàng</a></th>
      <th class="table-header-repeat line-left" width="140"><a href="">Hotel</a></th>
      <th class="table-header-repeat line-left"><a href="">Loại phòng</a></th>
      <th class="table-header-repeat line-left" width="140"><a href="">Ngày check -in </a></th>
      <th class="table-header-repeat line-left" width="100"><a href="">Total</a></th>
      <th class="table-header-repeat line-left" width="80"><a href="">Create Date</a></th>
      <th class="table-header-repeat line-left" width="80"><a href="">Thanh Toán</a></th>
      <th class="table-header-repeat line-left" width="80"><a href="">Hoàn Thành</a></th>
      <th class="table-header-repeat line-left" width="80"><a href="">View</a></th>
    </tr>
     <? 
			if( $orders!=null) {
			for ($i=0;$i<count($orders);$i++) {
                           //echo $orders[$i]['total'];
	?>
    <tr  >
      <td><input type="checkbox" name="iddel[]" class="ui-helper-hidden-accessible" value="<?=$orders[$i]["id"]?>" id="check<?=$i?>" /></td>
      <td><?=$orders[$i]["id"]?></td>
      <td><?=$orders[$i]["name"]?></td>
      <td><a href="admin.php?do=hotels&act=edit&id=<?=$orders[$i]["id_hotel"]?>"> <?=$orders[$i]["name_vn"]?> </a></td>
      <td align="center"><a href="admin.php?do=roomtype&hotelid=<?=$orders[$i]["id_hotel"]?>&act=edit&id=<?=$orders[$i]["id_room"]?>&cid=&root=">
        <?=$orders[$i]['room_name_vn']?>
        </a></td>
      <td><?=$orders[$i]["room_name_vn"]?></td>
      <td align="center"><?=$orders[$i]['total']?></td>
      <td align="center"><?=$orders[$i]['create_date']?></td>
      <td valign="middle"><a href="admin.php?do=orders&act=change_status&id=<?=$orders[$i]["id"]?>&current=<?=$orders[$i]["status"]?>&page=<?=isset($_GET['page'])?$_GET['page']:1; ?>">
        <?php
																if($orders[$i]["status"]=='1'){
															?>
        <img src="images/admin/checked.png" border="0"  width="24" height="24" title="Edit"/>
        <?	}else{	?>
        <img src="images/admin/hide.png" border="0"  width="24" height="24" title="Edit"/>
        <?	}	?>
        </a>
      </td>
      <td valign="middle"><a href="admin.php?do=orders&act=change_complete&id=<?=$orders[$i]["id"]?>&current=<?=$orders[$i]["complete"]?>&page=<?=isset($_GET['page'])?$_GET['page']:1; ?>">
        <?php
																if($orders[$i]["complete"]=='1'){
															?>
        <img src="images/admin/checked.png" border="0"  width="24" height="24" title="Edit"/>
        <?	}else{	?>
        <img src="images/admin/hide.png" border="0"  width="24" height="24" title="Edit"/>
        <?	}	?>
        </a>
     </td>
     <td><a class="icon-1 info-tooltip" title="Preview" href="javascript:popUp('<?=$domain?>/PreviewOrder.php?id=<?=$orders[$i]['id']?>');"></a></td>
    </tr>
    <?  }}else{ ?>
    <tr>
      <td colspan="9" align="center"><strong>No Data</strong></td>
    </tr>
    <? } ?>
  </tbody>
</table>
<!--  start paging.............. -->
<?=$plpage?>
<!--  end paging................ --> 
